/*
 * 组织/职务 API
 *
 * @author tqfeiyang
 * @since 2024-09-19
 */

import { postRequest, getRequest, getDownload } from '/@/lib/axios';

export const positionApi = {
    // 职务-分页查询
    getPositionPage(params) {
        return getRequest('@/api/business/organization/position/getPositionPage', params);
    },

    // 职务-获取全部
    getAllPositionList() {
        return getRequest('@/api/business/organization/position/getAllPositionList');
    },

    // 职务-获取详情
    getPositionInfo(positionId) {
        return getRequest(`@/api/business/organization/position/getPositionInfo/${positionId}`);
    },

    // 职务-添加
    createPosition(data) {
        return postRequest('@/api/business/organization/position/createPosition', data);
    },

    // 职务-修改
    updatePosition(positionId, data) {
        return postRequest(`@/api/business/organization/position/updatePosition/${positionId}`, data);
    },

    // 职务-删除
    deletePosition(positionId) {
        return postRequest(`@/api/business/organization/position/deletePosition/${positionId}`);
    },

    // 职务-批量删除
    batchDeletePositions(positionIds) {
        return postRequest('@/api/business/organization/position/batchDeletePositions', positionIds);
    },

    // 职务-导出Excel
    exportPositionsToExcel(params) {
        return getDownload('@/api/business/organization/position/exportPositionsToExcel', params);
    },

    // 职务-下载模板
    downloadPositionTemplate() {
        return getDownload('@/api/business/organization/position/downloadPositionTemplate');
    },

    // 职务-导入Excel
    importPositionsFromExcel(file) {
        return postRequest('@/api/business/organization/position/importPositionsFromExcel', file);
    },
};
